import request from '@/utils/request'

// 获取角色信息列表
export const getRoleListAPI = (params) => request({
    url: '/sys/role',
    method: 'GET',
    params
})

// 获取公司信息
export const getCompanyInfoAPI = (companyId) => request({
    url: `/company/${companyId}`,
    method: 'GET'
})

// 删除角色
export const deleteRoleAPI = (id) => request({
    url: `/sys/role/${id}`,
    method: 'DELETE'
})

// 编辑角色接口
export const editRoleAPI = (data) => request({
    url: `/sys/role/${data.id}`,
    method: 'PUT',
    data
})

// 读取角色信息接口
export const getRoleDetailAPI = (id) => request({
    url: `/sys/role/${id}`,
    method: 'GET'
})

// 新增角色接口
export const addRoleAPI = (data) => request({
    url: '/sys/role',
    method: 'POST',
    data
})

// 给角色分配权限
export const assignPerm = (data) => request({
    url: '/sys/role/assignPrem',
    method: 'PUT',
    data
})